﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using BusinessObjects;
using DemoObject;
using DemoObject.EntityMappers;

public partial class Module_Photos_Controls_AlbumList : System.Web.UI.UserControl
{
    private const int PageSize = 12;
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            int page = 1;
            if (Request["page"] != null)
                page = int.Parse(Request["page"]);
            HashSet<string> hs = new HashSet<string>();
            hs.Add("DisplayOrder ASC");
            int RowCount = 0;
            IList<TblAlbum> ls = TblAlbumRepository.CreateInstant().SelectListItem(null, "", "", true, null, page, PageSize, out RowCount, hs);
            rpt.DataSource = ls;
            rpt.DataBind();
            smartPager.PageSize = PageSize;
            smartPager.QueryStringKey = "page";
            smartPager.RowCount = RowCount;
            smartPager.UrlFormatString = "/hinh-anh/trang-{0}.html";// UrlBuilder.UrlAlbumPaging();
            smartPager.Visible = RowCount > PageSize;

        }
        SetTitle();
    }
    void SetTitle()
    {
        string title = "Thư viện hình ảnh";
        string description = "Thư viện hình ảnh";
        string keywords = "Thư viện hình ảnh";
        MasterPage _page = this.Page.Master;
        HTT.Utility.WebUtility.SetPage(title, description, keywords, _page);
    }
}
